from typing import List


def singleNumber(self, nums: List[int]) -> int:
    single = 0
    for num in nums:
        single ^= num
    return single
